package cn.mhome.merchant.framework.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.mhome.merchant.framework.util.MenuUtil;

/***
 * 
 * ClassName:cn.damai.plus.maizuo.controller.rest.MenuRestController <br/>
 * 描述:菜单相关rest公共接口 <br/>
 * 
 * @version
 * @since 1.0
 */
@Controller
@RequestMapping("/system/menu")
public class SysMenuController{
	protected final Logger logger = LoggerFactory.getLogger(SysMenuController.class);
	
	/***
	 * @return 查询菜单列表根据当前用户
	 * @since 1.0
	 */
	@RequestMapping(value = "/list", method = { RequestMethod.POST,
			RequestMethod.GET }, produces = "application/json;charset=UTF-8")
	@ResponseBody
	public String list(HttpServletRequest request) {
		try {
			return MenuUtil.getMenuJson();
		} catch (Exception e) {
			e.printStackTrace();
			return "[]";
		}
	}
}
